clear
set more off
capture log close
set matsize 10000


log using "appendix.txt", replace

*Merge municipality data with kulturkampf data
do "prepare kulturkampf"

*Prepare interactions for acreg command
gen cath_prus = catholic_share*prussia
gen cath_oppress = catholic_share*intensity_court
gen cath_intens = catholic_share*ln_intensity

*Table A1: Descriptive statistics on variables used in the main analysis
eststo clear
estpost summarize afd_share unemployment empl_marginal empl_regular population_1000 university foreign_share pop65_share female_share border_dist catholic_share prussia if east == 0  & catholic_share !=.
esttab, replace cells("count mean (fmt(2)) sd (fmt(2)) min (fmt(2)) max(fmt(2)) ") order (afd_share catholic_share prussia)

*Table A2: Court districts with highest intensity of oppression
preserve
collapse (mean) intensity_court, by(court_district)
gsort -intensity_court
list court_district intensity_court in 1/10
restore

*Table A3: Membership share of the “Volksverein” among all Catholics in 1913 and 1927
preserve
collapse (median) prussia volksverein_1913 volksverein_1927, by (diocese)
gsort -prussia -volksverein_1913
list prussia diocese volksverein_1913 volksverein_1927
restore

*Table A4: Mean relative Katholikentag participation, controlling for distance to location
preserve
collapse (first) prussia katholikentag_est, by (diocese_1990)
gsort -prussia -katholikentag_est
list prussia diocese_1990 katholikentag_est
restore



*Table B1: Main specification with alternative standard errors
eststo clear
quiet eststo Interaction_20: acreg afd_share catholic_share prussia cath_prus i.state [weight=voters] if east == 0, latitude(_CX) longitude(_CY) dist(20) spatial
quiet eststo Full_Model_20: acreg afd_share unemployment empl_marginal empl_regular population_1000 university foreign_share pop65_share female_share border_dist catholic_share prussia cath_prus i.state [weight=voters] if east == 0, latitude(_CX) longitude(_CY) dist(20) spatial
quiet eststo Interaction_100: acreg afd_share catholic_share prussia cath_prus i.state [weight=voters] if east == 0, latitude(_CX) longitude(_CY) dist(100) spatial
quiet eststo Full_Model_100: acreg afd_share unemployment empl_marginal empl_regular population_1000 university foreign_share pop65_share female_share border_dist catholic_share prussia cath_prus i.state [weight=voters] if east == 0, latitude(_CX) longitude(_CY) dist(100) spatial

estout, cells(b(star fmt(3)) se(par fmt(3))) starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001)  ///
collab(none) stats(N r2, fmt(0 3)) varwid(30) drop (*.state) 

*Table B2: Intensity specification without controls, alternative standard errors
eststo clear
quiet eststo Intensity_clustered: reg afd_share catholic_share intensity_court cath_oppress i.state [weight=voters] if east == 0, vce(cluster court_district)
quiet eststo Intensity_20: acreg afd_share catholic_share intensity_court cath_oppress i.state [weight=voters] if east == 0, latitude(_CX) longitude(_CY) dist(20) spatial
quiet eststo Intensity_50: acreg afd_share catholic_share intensity_court cath_oppress i.state [weight=voters] if east == 0, latitude(_CX) longitude(_CY) dist(50) spatial
quiet eststo Intensity_100: acreg afd_share catholic_share intensity_court cath_oppress i.state [weight=voters] if east == 0, latitude(_CX) longitude(_CY) dist(100) spatial


estout, cells(b(star fmt(3)) se(par fmt(3))) starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) ///
collab(none) stats(N r2, fmt(0 3)) varwid(30) drop(*.state) /// 
order (catholic_share intensity_court cath_oppress) 

*Table B3: Intensity specification with controls, alternative standard errors
eststo clear
quiet eststo Intensity_clustered: reg afd_share unemployment empl_marginal  empl_regular population_1000 university foreign_share pop65_share female_share border_dist catholic_share intensity_court cath_oppress i.state [weight=voters] if east == 0, vce(cluster court_district)
quiet eststo Intensity_20: acreg afd_share unemployment empl_marginal  empl_regular population_1000 university foreign_share pop65_share female_share border_dist catholic_share intensity_court cath_oppress i.state [weight=voters] if east == 0, latitude(_CX) longitude(_CY) dist(20) spatial
quiet eststo Intensity_50: acreg afd_share unemployment empl_marginal  empl_regular population_1000 university foreign_share pop65_share female_share border_dist catholic_share intensity_court cath_oppress i.state [weight=voters] if east == 0, latitude(_CX) longitude(_CY) dist(50) spatial
quiet eststo Intensity_100: acreg afd_share unemployment empl_marginal  empl_regular population_1000 university foreign_share pop65_share female_share border_dist catholic_share intensity_court cath_oppress i.state [weight=voters] if east == 0, latitude(_CX) longitude(_CY) dist(100) spatial


estout, cells(b(star fmt(3)) se(par fmt(3))) starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001)  ///
collab(none) stats(N r2, fmt(0 3)) varwid(30) drop (*.state) /// 
order (catholic_share intensity_court cath_oppress)


*Table C1: Robustness Checks for East Germany and Catholic municipalities
eststo clear
quiet eststo east: acreg afd_share catholic_share prussia cath_prus i.state [weight=voters] if east == 1, latitude(_CX) longitude(_CY) dist(50) spatial
quiet eststo east_controls: acreg afd_share unemployment empl_marginal  empl_regular population_1000 university foreign_share pop65_share female_share border_dist catholic_share prussia cath_prus i.state [weight=voters] if east == 1, latitude(_CX) longitude(_CY) dist(50) spatial
quiet eststo Cathreg: acreg afd_share catholic_share prussia cath_prus i.state [weight=voters] if east == 0 & catholic_share >= 66, latitude(_CX) longitude(_CY) dist(50) spatial
quiet eststo Cathreg_controls: acreg afd_share unemployment empl_marginal  empl_regular population_1000 university foreign_share pop65_share female_share border_dist catholic_share prussia cath_prus i.state [weight=voters] if east == 0 & catholic_share >= 66, latitude(_CX) longitude(_CY) dist(50) spatial

estout, cells(b(star fmt(3)) se(par fmt(3))) starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) ///
collab(none) stats(N r2, fmt(0 3)) varwid(30) drop (*.state) /// 
order (catholic_share prussia cath_prus) 

*Table C2: AfD vote share on the municipal level 2017, West Germany, no state fixed effects
eststo clear
quiet eststo Catholic: acreg afd_share catholic_share [weight=voters] if east == 0, latitude(_CX) longitude(_CY) dist(50) spatial
quiet eststo Interaction: acreg afd_share catholic_share prussia cath_prus  [weight=voters] if east == 0, latitude(_CX) longitude(_CY) dist(50) spatial
quiet eststo Full_Model: acreg afd_share unemployment empl_marginal  empl_regular population_1000 university foreign_share pop65_share female_share border_dist catholic_share prussia cath_prus [weight=voters] if east == 0, latitude(_CX) longitude(_CY) dist(50) spatial
quiet eststo Intensity: reg afd_share catholic_share intensity_court cath_oppress [weight=voters] if east == 0, vce(cluster court_district)
quiet eststo Intensity_controls: reg afd_share unemployment empl_marginal  empl_regular population_1000 university foreign_share pop65_share female_share border_dist catholic_share intensity_court cath_oppress [weight=voters] if east == 0, vce(cluster court_district)


estout, cells(b(star fmt(3)) se(par fmt(3))) starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001)  ///
collab(none) stats(N r2, fmt(0 3)) varwid(30) drop () /// 
order (catholic_share prussia cath_prus intensity_court cath_oppress) 

*Table C3: Analysis of mechanism, no state fixed effects
eststo clear
quiet eststo Interaction_1913: reg afd_share c.catholic_share##c.volksverein_1913 [weight=voters] if east == 0, vce(cluster diocese)
quiet eststo Interaction_1927: reg afd_share c.catholic_share##c.volksverein_1927 [weight=voters] if east == 0, vce(cluster diocese)
quiet eststo Katholikentage: reg afd_share c.catholic_share##c.katholikentag_est [weight=voters] if east == 0, vce(cluster diocese_1990)
quiet eststo Attendance: reg afd_share c.catholic_share##c.attendance  [weight=voters] if east == 0, vce(cluster diocese_1990)

estout, cells(b(star fmt(3)) se(par fmt(3))) starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001)  ///
collab(none) stats(N r2, fmt(0 3)) varwid(30) drop () 

*Table C4: AfD vote share on the municipal level 2017, West Germany, historical controls
eststo clear
quiet eststo Interaction: acreg afd_share catholic_share prussia cath_prus i.state agr_empl_1895 urban_pop_1900 ind_empl_1895 non_german_sp_1900 landgini1895 [weight=voters] if east == 0, latitude(_CX) longitude(_CY) dist(50) spatial
quiet eststo Intensity: reg afd_share catholic_share intensity_court cath_oppress i.state agr_empl_1895 urban_pop_1900 ind_empl_1895 non_german_sp_1900 landgini1895 [weight=voters] if east == 0, vce(cluster court_district)

estout, cells(b(star fmt(3)) se(par fmt(3))) starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) ///
collab(none) stats(N r2, fmt(0 3)) varwid(30) drop (*.state) order(catholic_share prussia cath_prus intensity_court cath_oppress)


*Table C5: AfD vote share on the municipal level 2017, alternative Kulturkampf measure
eststo clear
quiet eststo Court: acreg afd_share catholic_share intensity_court cath_oppress i.state [weight=voters] if east == 0, latitude(_CX) longitude(_CY) dist(50) spatial
quiet eststo Court_controls: acreg afd_share catholic_share intensity_court cath_oppress unemployment empl_marginal empl_regular population_1000 university foreign_share pop65_share female_share border_dist i.state [weight=voters] if east == 0, latitude(_CX) longitude(_CY) dist(50) spatial
quiet eststo Intensity: acreg afd_share catholic_share ln_intensity cath_intens i.state [weight=voters] if east == 0, latitude(_CX) longitude(_CY) dist(50) spatial
quiet eststo Intensity_controls: acreg afd_share catholic_share ln_intensity cath_intens unemployment empl_marginal empl_regular population_1000 university foreign_share pop65_share female_share border_dist i.state [weight=voters] if east == 0, latitude(_CX) longitude(_CY) dist(50) spatial

estout, cells(b(star fmt(3)) se(par fmt(3))) starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) ///
collab(none) stats(N r2, fmt(0 3)) varwid(30) drop (*.state) /// 
order (catholic_share intensity_court cath_oppress ln_intensity cath_intens) 

*Table D1: Birthplaces of candidates for beatifications or canonizations
clear
use "Replication\dataset_canonizations.dta"
tab state

*Table D2: Regional distribution of birthplaces, by time period
tab pre1815 prussia
tabulate pre1815 Preussen, chi2



*Table E1: Balance of the RDD, averages weighted by population
clear
use "Replication\dataset_municipalities_kulturkampf.dta", replace
preserve
keep if bundesland == "Rheinland-Pfalz" & (prussia == 1 | bavaria == 1)

balancetable prussia catholic_share unemployment empl_marginal empl_regular population_1000 university foreign_share pop65_share female_share using "tableE1.xls" [aweight=voters] if bav_prus_dist < 25, replace

restore

*Table E2: Full model of the RDD with different cutoffs
eststo clear
quiet eststo _25km: reg afd_share c.catholic_share##i.prussia##c.border_rel [weight=voters] if bundesland == "Rheinland-Pfalz" & bav_prus_dist < 25 & (prussia == 1 | bavaria == 1), vce(cluster gemeindeverband)
quiet eststo _25km_controls: reg afd_share c.catholic_share##i.prussia##c.border_rel unemployment empl_marginal empl_regular population_1000 university foreign_share pop65_share female_share [weight=voters] if bundesland == "Rheinland-Pfalz" & bav_prus_dist < 25 & (prussia == 1 | bavaria == 1), vce(cluster gemeindeverband)
quiet eststo _20km: reg afd_share c.catholic_share##i.prussia##c.border_rel [weight=voters] if bundesland == "Rheinland-Pfalz" & bav_prus_dist < 20 & (prussia == 1 | bavaria == 1), vce(cluster gemeindeverband)
quiet eststo _20km_controls: reg afd_share c.catholic_share##i.prussia##c.border_rel unemployment empl_marginal empl_regular population_1000 university foreign_share pop65_share female_share [weight=voters] if bundesland == "Rheinland-Pfalz" & bav_prus_dist < 20 & (prussia == 1 | bavaria == 1), vce(cluster gemeindeverband)
quiet eststo _30km: reg afd_share c.catholic_share##i.prussia##c.border_rel [weight=voters] if bundesland == "Rheinland-Pfalz" & bav_prus_dist < 30 & (prussia == 1 | bavaria == 1), vce(cluster gemeindeverband)
quiet eststo _30km_controls: reg afd_share c.catholic_share##i.prussia##c.border_rel unemployment empl_marginal empl_regular population_1000 university foreign_share pop65_share female_share [weight=voters] if bundesland == "Rheinland-Pfalz" & bav_prus_dist < 30 & (prussia == 1 | bavaria == 1), vce(cluster gemeindeverband)


estout, cells(b(star fmt(3)) se(par fmt(3))) starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) ///
order (1.prussia catholic_share border_rel 1.prussia#c.catholic_share 1.prussia#c.border_rel c.catholic_share#c.border_rel) ///
collab(none) stats(N r2, fmt(0 3)) legend numbers varwid(30) drop (0.*) 

*Table F1: Analysis of mechanism including contemporary control variables
eststo clear
quiet eststo Full_model_1913: reg afd_share c.catholic_share##c.volksverein_1913 unemployment empl_marginal empl_regular population_1000 university foreign_share pop65_share female_share border_district i.state [weight=voters] if east == 0, vce(cluster diocese)
quiet eststo Full_model_1927: reg afd_share c.catholic_share##c.volksverein_1927 unemployment empl_marginal empl_regular population_1000 university foreign_share pop65_share female_share border_district i.state [weight=voters] if east == 0, vce(cluster diocese)
quiet eststo Full_model_Kathtag: reg afd_share c.catholic_share##c.katholikentag_est unemployment empl_marginal empl_regular population_1000 university foreign_share pop65_share female_share border_district i.state [weight=voters] if east == 0, vce(cluster diocese_1990)
quiet eststo Attendance_controls: reg afd_share c.catholic_share##c.attendance unemployment empl_marginal empl_regular population_1000 university foreign_share pop65_share female_share border_district i.state [weight=voters] if east == 0, vce(cluster diocese_1990)

estout, cells(b(star fmt(3)) se(par fmt(3))) starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) ///
order (catholic_share volksverein_1913 c.catholic_share#c.volksverein_1913 volksverein_1927 c.catholic_share#c.volksverein_1927 katholikentag_est c.catholic_share#c.katholikentag_est attendance c.catholic_share#c.attendance) ///
collab(none) stats(N r2, fmt(0 3)) legend numbers drop(*.state)

*Table G1: Effect of Prussia and Catholicism on Centre Party vote shares in Reichstag elections, entire German empire
eststo clear
clear
use "dataset_german_empire.dta", replace
foreach x in 1871 1874 1877 1878 1881 1884 1887 1890 1893 1898 1903 1907 1912 {
          quietly eststo r`x': reg `y' zentrumshare c.catholic_share##i.prussia agr_empl_1895 ind_empl_1895 urban_pop_1900 landgini1895 non_german_sp_1900  if yr == `x'
        }	

estout, cells(b(star fmt(3)) se(par fmt(3))) starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) stats(N r2, fmt(%9.0fc 3)) ///
order (catholic_share 1.prussia 1.prussia#c.catholic_share agr_empl_1895 ind_empl_1895 urban_pop_1900 landgini1895 non_german_sp_1900) ///
mlab("1871" "1874" "1877" "1878" "1881" "1884" "1887" "1890" "1893" "1898" "1903" "1907" "1912") modelwidth(8) drop(0.* _cons)


*Table G2: Effect of Prussia and Catholicism on Centre Party vote shares in Reichstag elections, West Germany
eststo clear
foreach x in 1871 1874 1877 1878 1881 1884 1887 1890 1893 1898 1903 1907 1912 {
          quietly eststo r`x': reg `y' zentrumshare c.catholic_share##i.prussia agr_empl_1895 ind_empl_1895 urban_pop_1900 landgini1895 non_german_sp_1900 if yr == `x' & east == 0
        }	


estout, cells(b(star fmt(3)) se(par fmt(3))) starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) stats(N r2, fmt(%9.0fc 3)) ///
order (catholic_share 1.prussia 1.prussia#c.catholic_share agr_empl_1895 ind_empl_1895 urban_pop_1900 landgini1895 non_german_sp_1900) ///
mlab("1871" "1874" "1877" "1878" "1881" "1884" "1887" "1890" "1893" "1898" "1903" "1907" "1912") modelwidth(8) drop(0.* _cons)

*Table G3: Effect of Kulturkampf and Catholicism on Centre Party vote shares in Reichstag elections, West Germany
eststo clear
foreach x in 1871 1874 1877 1878 1881 1884 1887 1890 1893 1898 1903 1907 1912 {
          quietly eststo r`x': reg `y' zentrumshare c.catholic_share##c.intensity_court agr_empl_1895 ind_empl_1895 urban_pop_1900 landgini1895 non_german_sp_1900 if yr == `x'  & east == 0
        }

estout, cells(b(star fmt(3)) se(par fmt(3))) starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) stats(N r2, fmt(%9.0fc 3)) ///
order (catholic_share intensity_court c.catholic_share#c.intensity_court agr_empl_1895 ind_empl_1895 urban_pop_1900 landgini1895 non_german_sp_1900) ///
mlab("1871" "1874" "1877" "1878" "1881" "1884" "1887" "1890" "1893" "1898" "1903" "1907" "1912") modelwidth(8) drop(_cons)


*Table H1: Support for Catholic candidate in the Weimar presidential election of 1925, second ballot
eststo clear
clear
use "dataset_1925election.dta", replace

gen non_bavaria = 1 - bavaria
eststo national: reg Marx_share i.non_bavaria##c.cat_share [weight=valid], vce(cluster wkr)
preserve 
keep if wkr== 21 | wkr == 27
eststo RLP: reg Marx_share i.non_bavaria##c.cat_share [weight=valid]
restore

estout, cells(b(star fmt(3)) se(par fmt(3))) starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) stats(N r2, fmt(%9.0fc 3)) drop(0.*)

*Table I1
clear
use "dataset_individual.dta", replace


keep if education > 0
keep if unemployed >= 0
keep if eligible == 1

eststo clear
quietly eststo prussia: logit thermometer_AfD_bin i.prussia_bin##i.catholic gender age abitur unemployed std_income [pweight = vn_w_ipfwes] if eastwest == 1 & std_income >= 0 & thermometer_AfD > 0, vce(cluster Wahlkreis_Nr)
quietly eststo intensität: logit thermometer_AfD_bin c.intensity_court##i.catholic gender age abitur unemployed std_income [pweight = vn_w_ipfwes] if eastwest == 1 & std_income >= 0 & thermometer_AfD > 0, vce(cluster Wahlkreis_Nr)
quietly eststo VV_1913: logit thermometer_AfD_bin c.volksverein_1913##i.catholic gender age abitur unemployed std_income [pweight = vn_w_ipfwes] if eastwest == 1 & std_income >= 0 & thermometer_AfD > 0, vce(cluster Wahlkreis_Nr)
quietly eststo VV_1927: logit thermometer_AfD_bin c.volksverein_1927##i.catholic gender age abitur unemployed std_income [pweight = vn_w_ipfwes] if eastwest == 1 & std_income >= 0 & thermometer_AfD > 0, vce(cluster Wahlkreis_Nr)
quietly eststo katholikentag: logit thermometer_AfD_bin c.katholikentag_est##i.catholic gender age abitur unemployed std_income [pweight = vn_w_ipfwes] if eastwest == 1 & std_income >= 0 & thermometer_AfD > 0, vce(cluster Wahlkreis_Nr)

estout, cells(b(star fmt(3)) se(par fmt(3))) starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) /// ///
collab(none) stats(N r2_p, fmt(0 3)) legend numbers  ///
order (1.catholic 1.prussia_bin 1.prussia_bin#1.catholic intensity_court 1.catholic#c.intensity_court ///
volksverein_1913 1.catholic#c.volksverein_1913 volksverein_1927 1.catholic#c.volksverein_1927 katholikentag_est 1.catholic#c.katholikentag_est) ///
drop(0.* 1.prussia_bin#0.catholic) 
